<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>店面发送信息统计</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		#searchForm div.ui-input-text {
			padding: 0.4em;
			display:inline-block;
		}
		#searchForm div.ui-input-button {
			padding: 0.4em;
			display:inline-block;
		}
	</style>
</head>
<body>
	<div class="icon-buttons">
		<input type="button" class="leave-clean-session" data-inline="true" data-icon="back" data-iconpos="notext" value="返回"/>
	</div>
	<tags:breadcrumb name="breadcrumb" />
	<form:form id="searchForm" modelAttribute="logStoreMsg" action="${ctx}/sms/logStoreMsg/list" method="post" class="middleCls">
		<label for="endDate">开始：</label>
		<input type="date" id="startDate" data-inline="true" name="startDate" value="${startDate}"/>
		<label for="endDate">结束：</label>
		<input type="date" id="endDate" data-inline="true" name="endDate" value="${endDate}"/>
		<input data-inline="true" type="submit" value="查询"/>
	</form:form>
	<div class="form-input">
		<table id="contentTable"  data-role="table" class="ui-responsive table-stroke">
			<thead><tr><th>类别</th><th>发送条数</th><th>实际条数</th></tr></thead>
			<tbody>
				<tr id="${not empty sendNotifyMsgSize && sendNotifyMsgSize != 0?'notify':''}">
					<td>客户产品和护理提示短信</td>
					<td>${not empty sendNotifyMsgSize?sendNotifyMsgSize:0}</td>
					<td>${not empty realNotifyMsgSize?realNotifyMsgSize:0}</td>
				</tr>
				<tr id="${not empty sendOtherAutoMsgSize && sendOtherAutoMsgSize != 0?'other':''}">
					<td>客户其它短信（生日/节假日）</td>
					<td>${not empty sendOtherAutoMsgSize?sendOtherAutoMsgSize:0}</td>
					<td>${not empty realOtherAutoMsgSize?realOtherAutoMsgSize:0}</td>
				</tr>
				<tr id="${not empty sendNewsStoreMsgSize && sendNewsStoreMsgSize != 0?'store':''}">
					<td>新店开业通知短信</td>
					<td>${not empty sendNewsStoreMsgSize?sendNewsStoreMsgSize:0}</td>
					<td>${not empty realNewsStoreMsgSize?realNewsStoreMsgSize:0}</td>
				</tr>
				<tr id="${not empty sendGroupMsgSize && sendGroupMsgSize != 0?'group':''}">
					<td>店面群发短信</td>
					<td>${not empty sendGroupMsgSize?sendGroupMsgSize:0}</td>
					<td>${not empty realGroupMsgSize?realGroupMsgSize:0}</td>
				</tr>
				<tr>
					<td colspan="3">备注：64个字计为一条</td>
				</tr>
			</tbody>
		</table>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#contentTable tbody tr").click(function(e){
				if (!this.id) {
					return;
				}
				$("#contentTable tbody tr").removeClass("select_active");
				$(this).addClass("select_active");
				var url = "${ctx}/sms/logStoreMsg/detail?type=" + this.id;
				window.location.href = url;
			});
		 	jQuery("#searchForm").validate({
		 		submitHandler: function(form){
					var startValue = $("#startDate").val();
					var endValue = $("#endDate").val();
					if (!startValue) {
						showTip("开始日期不能为空！");
						return;
					}
					if (!endValue) {
						showTip("结束日期不能为空！");
						return;
					}
					if(startValue && endValue){
						 var start = new Date(startValue.replace(/-/g, "/"));
						 var end = new Date(endValue.replace(/-/g, "/"));
						 if (end < start) {
							showTip("结束日期不能大于开始日期!");
							return;
						}
					 }
					 loading("正在提交，请稍等...");
					 form.submit();
				}
	        });
		});
	</script>
</body>
</html>
